package com.senthink.gl.business.userlog.enums;

import lombok.Getter;

import java.util.LinkedHashSet;
import java.util.Set;

/**
 * 操作日志 操作类型枚举类
 * @author yuanpeng@senthink.com
 * @data 2018-01-31 13:43
 */

@Getter
public enum LogOperateEnum {

    DEFAULT(0, "默认类型"),

    CREATE(1, "新建"),

    UPDATE(2, "编辑"),

    DELETE(3, "删除"),

    LOGIN_IN(4, "登录"),

    CONTROL(5, "控制");

    private Integer code;

    private String operate;

    public static final Set<String> set = new LinkedHashSet<>();

    static {
        for (LogOperateEnum enums : LogOperateEnum.values()) {
            if (enums != LogOperateEnum.DEFAULT) {
                set.add(enums.getOperate());
            }
        }
    }

    LogOperateEnum(Integer code, String operate) {
        this.code = code;
        this.operate = operate;
    }

    public static Set getSet() {
        return set;
    }
}
